void main() {
  AliPay aliPay = new AliPay();
  aliPay.pay(10.0);

  WechatPay wechatPay = new WechatPay();
  wechatPay.pay(20.0);

  Unionpay unionpay = new Unionpay();
  unionpay.pay(30.0);
}

/**
 * 抽象类
 * 只负责定义，不负责实现
 */
abstract class Payment {
  void pay(double money);
}

/**
 * 具体类
 * 继承抽象类，实现抽象方法
 */
class AliPay implements Payment {
  @override
  void pay(double money) {
    print("支付宝支付了${money}元");
  }
}

class WechatPay implements Payment {
  @override
  void pay(double money) {
    print("微信支付了${money}元");
  }
}

class Unionpay implements Payment {
  @override
  void pay(double money) {
    print("银联支付了${money}元");
  }
}
